home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic 4 Database How-To
/
Visual Basic 4 Database - How-to (The Waite Group)(1995).iso
/
secured.cl_
/
secured.cl
Wrap
Text File
|
1995-07-20
|
2KB
|
81 lines
VERSION 1.0 CLASS
BEGIN
MultiUse = 0 'False
END
Attribute VB_Name = "SecuredDatabase"
Attribute VB_Creatable = True
Attribute VB_Exposed = True
Option Explicit
'Private data access objects
Private db As DATABASE
Private rs As Recordset
Private dbFileName As String
Public Property Get BOF() As Boolean
BOF = rs.BOF
End Property
Public Property Get EOF() As Boolean
EOF = rs.EOF
End Property
Property Get FieldCount() As Long
FieldCount = rs.Fields.Count
End Property
Property Get RecordCount() As Long
Dim bm As String
'Save our location in the recordset
bm = rs.Bookmark
rs.MoveLast
RecordCount = rs.RecordCount
'Return to the starting position in the recordset
rs.Bookmark = bm
End Property
Public Function GetField(fieldNum As Integer) As Variant
GetField = rs.Fields(fieldNum).VALUE
End Function
Public Sub MoveFirst()
'Move to the first record in the recordset
rs.MoveFirst
End Sub
Public Sub MoveLast()
'Move to the last record
rs.MoveLast
End Sub
Public Sub MoveNext()
'Move to the next record
rs.MoveNext
End Sub
Public Sub MovePrevious()
'Move to the previous record
rs.MovePrevious
End Sub
Private Sub Class_Initialize()
'Include any database security access parameters here
dbFileName = App.Path & "\biblio.mdb"
Set db = OpenDatabase(dbFileName)
Set rs = db.OpenRecordset("Authors")
End Sub
Private Sub Class_Terminate()
Set db = Nothing
Set rs = Nothing
End Sub